package org.mozhu.mboot.core.json.jackson.jdk.deser;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;

import java.io.IOException;

abstract class JdkDeserializerBase<T> extends StdScalarDeserializer<T> {

    private static final long serialVersionUID = 4303771047244273506L;

    protected JdkDeserializerBase(Class<T> cls) {
        super(cls);
    }

    @Override
    public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException {
        return typeDeserializer.deserializeTypedFromAny(jp, ctxt);
    }
}
